package main

import (
	"fmt"
	"os/exec"
	"strings"
)

var (
	num         = 1
	defaultExec = "start D:/programs/WeChat/WeChat.exe"
	execSlice   = []string{}
)

func main() {
	fmt.Print("请输入要多开的微信数：")
	fmt.Scanf("%d", &num)
	for i := 0; i < num; i++ {
		execSlice = append(execSlice, defaultExec)
	}
	command := strings.Join(execSlice, " | ")
	cmd := exec.Command(`cmd`, `/c`, command)
	err := cmd.Start()
	if err != nil {
		fmt.Println(err)
		return
	}
}
